GA3 file will be the slow evolution file. The main goal will be testing to see if there is an effect caused by mutation rate or effect size when the mutational variance between two species is the same (a low).

Prediction: Higher mutation rate will be advantages in the beginning of a simulation. A higher effect size might lead to more spatial co-evolution. Space might influence the effects. - A non-spatial simulation with these values might be fun to compare

For the initial part of this experiment I will run four trials per GA combination

GA combinations:

Data Colllection

I have created some bash script to run through all the files in my data folders and add some columns and coagulate all of the files into one file per data set. In this case, there are three data sets; one for whole population data (lit), one for correlation data (cor), and one for individual grids (grid). After all of these files are created, I load it into R and finish adding in some comparative columns. I also load in my figure creation functions. There originally was a problem with naming where I was putting the newt information in first (fixed, but is something to be aware of moving forward).

## All cor, lit, and grid files exist!
## This program will now end!

Mean Phenotype Whole Simulation

The first thing that I observe is the general mean newt and snake phenotype trends across time. In the phenotype differences figure the red and blue lines represent mean newt and snake phenotype. The black lines are the differences between mean phenotypes of snakes and newts. The table shows the average mean phenotype differences from generation 100 to 50,000. In both the figure and table there will be a positive value when snakes have a higher phenotype and a negative value when newts have a higher phenotype.

Phenotype differences

Table of average Differences

##                      Group.1            x
## 1    1e-08_0.005_1e-08_0.005 -0.098163903
## 2   1e-08_0.005_1e-09_0.0158  0.016779364
## 3     1e-08_0.005_1e-10_0.05 -0.226664679
## 4    1e-08_0.005_1e-11_0.158  0.010813056
## 5   1e-09_0.0158_1e-08_0.005 -0.007287745
## 6  1e-09_0.0158_1e-09_0.0158  0.215621516
## 7    1e-09_0.0158_1e-10_0.05 -0.030173555
## 8   1e-09_0.0158_1e-11_0.158  0.250226883
## 9     1e-10_0.05_1e-08_0.005 -0.070659664
## 10   1e-10_0.05_1e-09_0.0158 -0.197977493
## 11     1e-10_0.05_1e-10_0.05 -0.102772523
## 12    1e-10_0.05_1e-11_0.158 -0.130457787
## 13   1e-11_0.158_1e-08_0.005  0.034135676
## 14  1e-11_0.158_1e-09_0.0158 -0.193835961
## 15    1e-11_0.158_1e-10_0.05  0.008829150
## 16   1e-11_0.158_1e-11_0.158 -0.145687471

In the phenotype differences figure the mean phenotypes of newts and snakes generally goes up. There are a few cases where the mean phenotype stays flat. There are two cases where the mean phenotype goes down (L, N, very rare). In most of the simulations newts end up having a higher mean phenotype (more black lines lower then 0 and negative means in the table). In the table, a larger value (both positive and negative) might indicate agreement between the simulation. A value closer to 0 can indicate a small difference between snake and newt mean phenotype or larger but opposite differences between snake and newt mean phenotype.

Connection between higher phenotype and population

Previous results show that there is a connection between phenotype and population size. Typically, when one species has a larger phenotype they also have a larger population size (special note; snakes tend to have slightly larger population size when newt and snake phenotypes are close). The phenotype differences figure shows the newt population size by snake population size. Each dot is one time point from the simulation, the dots shown are from generation 5,000 to 10,000. The color of the dots is the difference between snake and newt mean phenotype (more blue snakes have a higher phenotype, more red newts have a higher phenotype). The figure of phenotype and population size differences has two histograms. The purple histogram shows the difference between snake and newt phenotype. The green histogram shows the difference between snake and newt population size divided by 1000. I show one trials result below.

Phenotype differences

Phenotype & Populationsize differences

In these figures, snakes often had a larger population size (even when newts phenotype is larger). In the phenotype differences figure, GA combinations that had resulted in higher newt phenotypes also resulted with a closer snake-newt population size. The cluster of the results tended to be in the right bottom corner. When snakes had a larger phenotype the clues of points tended to be in the top left corner. When looking at the histograms the difference between phenotypes is small, but newts have a higher mean phenotype in more than half of the GA combinations. The more positive the mean phenotype the difference the more positive the mean population size difference.

Correlation

This next section is about spatial correlation! Over the course of two species co-evolving I predicted that there would be some areas in space when the phenotypes would both be higher and some areas when the phenotypes would both be lower. If this were true the spacial correlation would be high. However, the spatial correlation can also be negative or close to 0. It could be close to 0 if the mean phenotypes are randomly paired though out different locations. It could be negative if there is a high-low relationship between the phenotypes.

Collecting an accurate spatial correlation is difficult. What is the correct time point or set of time points to be measuring from? What is the correct amount of area to be measuring from? How does the spreading of phenotype affect this measurement? How does spatial correlation change over time? In this figure there are four box plots per GA combination. Each of these box plot is form a different trial. the dashed black line is the real newt and snake spatial correlation.

After looking at this figure, I can see that there is a larger range of correlation values. The can sometimes be positive, near 0, or negative. Very few reach (or come near) the real newt-snake correlation. How do you find the correct time slice to look for spatial correlation? How would these phenotypes become spatially correlated and then become not spatially correlated.

Correlation Histograms

In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all four trials correlation values. Each color is a different trial per GA combination. The histogram values are stacked.

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

What does it mean? Correlations seem to change a lot from time chunk to time chunk. They can go from positive to negative. Sometimes the trials seem to disagree. To get a better understanding of what might be going on in my simulation, I will plat the mean snake and newt phenotype and the spatial correlation over time.

Correlation across time

All of the correlations across time look very similar. Generally, mean newt and snake phenotypes (red and blue) go up overtime while the local correlation between the two fluctuates. Sometime one mean phenotype stays flat. The local correlations range from being very positive to being very negative. How can the correlation start to suddenly go up and then fall? It is hard to notice any differences between the GA combinations. For space I have chosen 3 random figures.

Random 1

Random 2

## [1] "pattern 1e-09_0.0158_1e-08_0.005_0"
## [1] "Cor between average snake pheno and local cor 0.319809243820222"
## [1] "Cor between average newt pheno and local cor 0.361965428645628"
## [1] "Cor between average dif pheno and local cor -0.323626476890391"
## [1] "Cor between newt pheno and snake 0.0870116025701392"

Random 3

## [1] "pattern 1e-08_0.005_1e-10_0.05_3"
## [1] "Cor between average snake pheno and local cor 0.745889480619513"
## [1] "Cor between average newt pheno and local cor 0.735329334823207"
## [1] "Cor between average dif pheno and local cor -0.626130918281528"
## [1] "Cor between newt pheno and snake 0.890994025839529"

I still wonder why the correlation values go up and down, because the mean newt and snake phenotype keeps going up. I wonder if the individuals might be moving around too much. I wonder what would happen on a larger map?

What happens over time (looking at the beginning, middle, and late part of my simulations)

This next section is just getting a glimpse at how newt & snake phenotype and population size differ over time. The populations start off with about 250 individuals each. Each individual has a different genetic background created from msprime.

Pheno Beginning

Pheno Middle

Pheno End

Dif Beginning

Dif Middle

Dif End

In the beginning of the simulation you can see how the population size of newts and snakes rises. You can also see that for most of the GA combinations there is already one species that has a phenotypic advantage. Over time the population size figure becomes more of an oval. The color gets more intense in the middle and end figures. In the purple and green figures the difference in snake and newt phenotype gets more pronounce from the beginning to the middle of the simulation. The difference in population size fluctuates a bit, but there are no noticeable terns in these figures.

Summary

In a previous simulation study (tall GA3) I saw a difference in population size and phenotype between the different GAs. I will try to see if these GA combination lead to differences in phenotypes and population sizes. We will compare newt population size to snake population size with each shape indicating newt GA and each color indicating snake GA. We will walk though the beginning, middle, and end of my simulation. We will also look at the snake population size by the difference between snake and newt phenotypes

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

After looking at the early population size summary, I noticed that at time when on the population size first spread out then started to gather in the center (into a diagonal line). There was no pattern or grouping between the shapes or colors. I saw the same thing in the difference summary. To confirm these finding I will now look at the heat maps.

Heatmap

In this section I look at the heat maps for snake population size and mean phenotype difference for the beginning, middle, and end of my simulation. For all of these plots newt GA will be on the x-axis. The snake GA and simulation trial will be on the y-axis (each four can be read as a group). This map y-axis is switched compared to all the other figures. For the population size maps as the color goes from dark (purple) to light (yellow) the snake population size increases. For the difference phenotype maps the mean difference goes from blue to red, with blue indicating snakes have a higher phenotype and red indicating that newts have a higher phenotype.

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

Again, I did not see a pattern between the GAs. I also did not see very good agreement between the trials. Results seemed very variable.

What is up with the correlations

This is the final section of this experiments’ markdown. There are three examples shown below. In each example there will be a map like plot (x and y are locations) with snake (square) and newt (circle) phenotype and population size represented with color. Each example will have the mean phenotype, max phenotype, min phenotype, and population size. These examples will highlight a high positive, low, and high negative spatial correlation.

High Correlation

Mean

## [1] 0.6130661

SD

## [1] 0.2222864

Max Phenotype

## [1] 0.6305863

Min Phenotype

## [1] 0.5354734

Population Size

## [1] 0.4110754

Near Zero Correlation

Mean

## [1] 0.08529869

SD

## [1] 0.3405517

Max Phenotype

## [1] 0.2952313

Min Phenotype

## [1] 0.1458309

Population Size

## [1] 0.3808622

Negative Correlation

Mean

## [1] -0.499732

SD

## [1] 0.2760917

Max Phenotype

## [1] -0.3178443

Min Phenotype

## [1] -0.2400429

Population Size

## [1] 0.4272941